package com.hitsf.controller;


import com.hitsf.bean.Department;
import com.hitsf.bean.HitUser;
import com.hitsf.mapper.HitUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class UserController {

    @Autowired
    HitUserMapper hitUserMapper;

    @GetMapping("/user/add")
    public HitUser insertDept(HitUser hitUser){
        hitUserMapper.insert(hitUser);
        return hitUser;
    }

    @GetMapping("/user/{id}")
    public HitUser getEmp(@PathVariable("id") String id){
        return hitUserMapper.selectByPrimaryKey(id);
    }
}
